package part1.language_basis.day03;

//if...else结构的演示
public class IfElseDemo {
    public static void main(String[] args) {

        //满500打8折 不满500打9折
        double price = 300.0;
        if (price>=500){
            price *= 0.8;
        }else {
            price *= 0.9;
        }
        System.out.println("最终消费金额为："+price);


        //判断成绩合法还是不合法
        int score = 95;
        if (score>=0 && score<=100){
            System.out.println(score+"是合法成绩");
        }else {
            System.out.println(score+"是不合法成绩");
        }

        //判断一个数的奇偶
        int num =4;
        if (num%2==0){
            System.out.println(num+"是偶数");
        }else {
            System.out.println(num+"是奇数");
        }
    }
}
